package ftdpc.centre;

import ftdpc.ITaskItemConfigManager;
import ftdpc.TaskDispatchBusinessManager;
import ftdpc.properties.TaskConfig;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

/**
 * 类描述:  任务调度管理中心
 *
 * @author 王雷
 * @version 1.0.0
 * @date 2021/1/19 0019 下午 4:17
 */
@EnableConfigurationProperties(value = TaskConfig.class)
public class DispatchTaskManagerCentre {

    /**
     * 功能描述：任务调度业务处理对象注入
     *
     * @param iTaskItemConfigManager 任务配置
     * @param applicationContext     上下文对象
     * @return 任务调度业务处理对象
     * @date : 2022/9/14 0014 上午 11:09
     */
    @Bean
    public TaskDispatchBusinessManager taskBusinessProcessing(ITaskItemConfigManager iTaskItemConfigManager, TaskConfig taskConfig
            , ApplicationContext applicationContext) {
        return new TaskDispatchBusinessManager(iTaskItemConfigManager, taskConfig, applicationContext);
    }

    /*@Bean
    public ThreadPoolTaskScheduler taskThreadPoolTaskScheduler(){
        return new ThreadPoolTaskScheduler();
    }*/
}
